#ifndef SEGMENT_H_
#define SEGMENT_H_

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <map>

#include "irrlicht.h"   // For vector3df

using irr::core::vector3df;

class segment_t;

std::ostream& operator<< (std::ostream& os, const segment_t& s);
std::ostream& operator<< (std::ostream& os, const vector3df& v);

// TODO: change all the floats to int ?

long long scalar_ll(irr::core::vector3d<long long> a, irr::core::vector3d<long long> b);
int scalar(irr::core::vector3df a, vector3df b);
vector3df vectorial(vector3df a, vector3df b);

float distance(const vector3df& p1, const vector3df& p2);

class segment_t: virtual public std::pair<irr::core::vector3df, irr::core::vector3df>
{
	protected:
	bool true_test_same_line(segment_t s1);

	public:
	vector3df vector();
	bool test_colinear(segment_t s1);
	bool test_same_line(segment_t s1);

	vector3df center();
	float distance_to(vector3df point);

	friend bool operator==(const segment_t& s1, const segment_t& s2);
	friend bool operator!=(const segment_t& s1, const segment_t& s2);
};

#endif

